package com.banciyuan.wallpaper.page;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;

import com.banciyuan.wallpaper.R;
import com.banciyuan.wallpaper.base.BaseActivity;
import com.banciyuan.wallpaper.services.ListenSevices;
import com.banciyuan.wallpaper.setting.SettingConfig;

/**
 * Created by squall on 2016/7/29.
 */
public class StartActivity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        startService(new Intent(getBaseContext(), ListenSevices.class));
    }

    @Override
    protected void onResume() {
        super.onResume();
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (!SettingConfig.isSettingExit(getBaseContext(), SettingConfig.SEX)) {
                    Intent intent = new Intent(StartActivity.this, SelectActivity.class);
                    startActivity(intent);
                    finish();
                } else {
                    Intent intent = new Intent(StartActivity.this, MainActivity.class);
                    startActivity(intent);
                    finish();
                }
            }
        }, 1500);
    }


}
